﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EP.Caching.Attributes {
	[Serializable]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
	public class CacheTimeoutAttribute : Attribute {
		#region Fields / Properties
		private readonly TimeSpan? _SlidingTimeout;
		public TimeSpan? SlidingTimeout { get { return _SlidingTimeout; } }

		private DateTimeOffset? _AbsoluteTimeout;
		public DateTimeOffset? AbsoluteTimeout { get { return _AbsoluteTimeout; } }
		#endregion

		#region Constructor
		public CacheTimeoutAttribute(TimeSpan? slidingTimeout, DateTimeOffset? absoluteTimeout) {
			_SlidingTimeout = slidingTimeout;
			_AbsoluteTimeout = absoluteTimeout;
		}
		#endregion
	}
}
